<?php
namespace app\api\model;
use think\Model;
class Jifen extends Model
{
    public function index()
    {   
       
    }
 
     public function add($token,$bianhao,$add)
     {
         $data = [
            'token'=>$token,
            'bianhao'=>$bianhao,
            'leixing'=>1,
             'number'=>$add,
             'zhuangtai'=>1,
         ];
         $count = model('jifen')->insert($data);
         return $count;
     }

     public function reduce($token,$bianhao,$reduce)
     {
           $data = [
              'token'=>$token,
              'bianhao'=>$bianhao,
              'leixing'=>-1,
              'number'=>$reduce*10,
              'zhuangtai'=>1,
           ];
           $count = model('jifen')->insert($data);
           return $count;
     }

}